package com.gordon.wiki.service.Impl;

import com.gordon.wiki.websocket.WebSocketServer;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @Projectname: wiki
 * @Filename: WsService
 * @Author: GordonLo
 * @Data:2022/11/22 15:20
 * @Description: TODO
 */
@Service
public class WsService {

    @Autowired
    private WebSocketServer webSocketServer;

    @Async
    public void sendInfo(String message, String logId) {
        MDC.put("LOG_ID", logId);
        webSocketServer.sendInfo(message);
    }
}
